﻿Public Class KNChamCong
    Private dt As New Database_
    Private sql As String
    Public Function DataCC(ByVal str As String) As DataTable
        sql = "select * from THANGCONG t where t.Thang='" & str & "'"
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
    Public Function DataC() As DataTable
        sql = "select t.* from THANGCONG t "
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
    Public Function SaveCC(ByVal data As DataTable) As Boolean
        sql = "select * from THANGCONG "
        Return dt.ExecUpdate(sql, data)
    End Function

    'lay ds dem ngay cong cho bang luong thang
    Public Function DataTinh(ByVal thang As String) As DataTable
        sql = "select t.* from THANGCONG t ,NHANVIEN n , CTTHANG c where n.MaNV=c.MaNV  and c.MThang=t.MThang and c.Thang='" & thang & "'"
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
    Public Function DKDSL(ByVal thang As String) As DataTable
        sql = "select t.* from THANGCONG t, CTTHANG c where and c.MThang=t.MThang and c.Thang='" & thang & "'"
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
    Public Function DataCTThang(ByVal thang As String) As DataTable
        sql = "select * from CTThang c where c.Thang='" & thang & "'"
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
End Class
